package com.example.link.controller;

import com.example.link.service.LinkAccessService;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author qwert
 * @version 1.0.0
 * @create 2025/8/18 23:12
 **/
@RestController
@RequestMapping()
@RequiredArgsConstructor
public class LinkAccessController {

    private final LinkAccessService linkAccessService;
    @GetMapping("/{uri}")
    public void restoreUrl(@PathVariable("uri") String shortUri, ServletRequest request, ServletResponse response) {
        linkAccessService.restoreUrl(shortUri, request, response);
    }
}
